import request from '@/utils/request'

/**
 * 获取首页分类数据
 * @returns {Promise}
 */
export const getHomeCategoryApi = () => {
  return request.get('/home/category/head')
}

/**
 * 获取首页热门数据
 * @returns {Promise}
 */
export const getHomeHotApi = () => {
  return request.get('/home/hot')
}

/**
 * 获取首页品牌数据
 * @returns {Promise}
 */
export const getHomeBrandApi = () => {
  return request.get('/home/brand')
}

/**
 * 获取首页广告数据
 * @param {Object} params
 * @returns {Promise}
 */
export const getHomeBannerApi = (params = {}) => {
  const { distributionSite = 1 } = params
  return request.get('/home/banner', { params: { distributionSite } })
}

/**
 * 获取首页新鲜好物数据
 * @returns {Promise}
 */
export const getHomeNewApi = () => {
  return request.get('/home/new')
}

/**
 * 获取首页商品数据
 * @returns {Promise}
 */
export const getHomeGoodsApi = () => {
  return request.get('/home/goods')
}
